<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>支付成功 - 小说精品屋-plus</title>
  <style>
    body {
      font-family: 'Microsoft YaHei', sans-serif;
      background-color: #f5f5f5;
      margin: 0;
      padding: 0;
      display: flex;
      justify-content: center;
      align-items: center;
      height: 100vh;
    }
    .success-container {
      background-color: white;
      border-radius: 8px;
      box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
      padding: 30px;
      width: 400px;
      text-align: center;
    }
    .success-icon {
      color: #52c41a;
      font-size: 48px;
      margin-bottom: 20px;
    }
    h1 {
      color: #333;
      margin-bottom: 20px;
    }
    .order-info {
      background-color: #f9f9f9;
      padding: 15px;
      border-radius: 4px;
      margin-bottom: 20px;
      text-align: left;
    }
    .info-item {
      margin-bottom: 8px;
      display: flex;
    }
    .info-label {
      font-weight: bold;
      width: 100px;
      color: #666;
    }
    .info-value {
      flex: 1;
    }
    .btn-back {
      background-color: #1890ff;
      color: white;
      border: none;
      padding: 10px 20px;
      border-radius: 4px;
      cursor: pointer;
      font-size: 16px;
      transition: background-color 0.3s;
    }
    .btn-back:hover {
      background-color: #40a9ff;
    }
  </style>
</head>
<body>
<div class="success-container">
  <div class="success-icon">✓</div>
  <h1>支付成功</h1>

  <div class="order-info">
    <div class="info-item">
      <span class="info-label">订单编号：</span>
      <span class="info-value" id="orderNo"></span>
    </div>
    <div class="info-item">
      <span class="info-label">支付金额：</span>
      <span class="info-value" id="payAmount"></span>
    </div>
    <div class="info-item">
      <span class="info-label">支付状态：</span>
      <span class="info-value">已支付</span>
    </div>
  </div>

  <button class="btn-back" onclick="window.location.href='/'">返回首页</button>
</div>

<script>
  // 从URL获取参数
  const urlParams = new URLSearchParams(window.location.search);
  const orderNo = urlParams.get('orderNo');
  const amount = urlParams.get('amount');
  document.getElementById('payAmount').textContent = '¥' + (amount || '0.00');
  // 显示订单信息
  document.getElementById('orderNo').textContent = orderNo || '--';

  // 注意：这里没有支付金额参数，如果需要可以修改后端传递
  // document.getElementById('payAmount').textContent = '¥' + (payAmount || '0.00');
</script>
</body>
</html>